package com.vhall.component.controller.exam.facade;


import com.vhall.component.entity.exam.dto.ExamAnswersDTO;
import com.vhall.component.entity.exam.dto.ExamDTO;
import com.vhall.component.entity.exam.dto.ExamInfoDTO;
import com.vhall.component.entity.exam.vo.*;
import com.vhall.component.entity.page.vo.PageVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.HashMap;

/**
 * @author lsl
 * @since 2021/6/16
 */
@FeignClient(value = "ExamConsoleFacade", path = "/v4/exam")
public interface ExamConsoleFacade {


    /**
     * 控制台 - 创建考卷
     *
     * @param vo 考卷创建参数
     * @return paper info
     */
    @PostMapping("/console/paper-create")
    ExamDTO paperCreate(@Validated ExamPaperCreateReqVo vo);


    /**
     * 控制台 - 试卷详情-预览
     *
     * @return paper info
     */
    @GetMapping("/console/paper-info")
    ExamDTO paperInfo(@Validated ExamPaperCopyReqVo vo);


    /**
     * 控制台 - 试卷详情-列表
     *
     * @param vo 考卷查询
     * @return paper info
     */
    @PostMapping("/console/paper-list")
    PageVO<ExamDTO> paperList(@Validated ExamPaperListReqVo vo);


    /**
     * 控制台 - 试卷绑定
     *
     * @param vo 考卷查询
     * @return paper info
     */
    @PostMapping("/console/paper-bind")
    boolean paperBind(@Validated ExamVo vo);

    /**
     * 控制台 - 试卷复制
     *
     * @param vo 考卷查询
     * @return paper info
     */
    @PostMapping("/console/paper-copy")
    ExamDTO paperCopy(@Validated ExamPaperCopyReqVo vo);

    /**
     * 考试详情，跟试卷详情不一样
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/info")
    ExamInfoDTO info(@Validated ExamInfoVo vo);

    /**
     * 创建考试记录
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/create")
    ExamDTO create(@Validated ExamCreateReqVo vo);

    /**
     * 考试-修改
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/update")
    ExamDTO update(@Validated ExamUpdateReqVo vo);

    /**
     * 试卷列表
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/list")
    PageVO<ExamConsoleListRspVO> list(@Validated ExamConsoleListReqVo vo);

    /**
     * 批阅列表
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/grade-list")
    PageVO<ExamAnswersDTO> gradeList(@Validated ExamGradeListReqVo vo);

    /**
     * 试卷-删除记录
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/delete")
    Integer delete(@Validated ExamDeleteConsoleReqVo vo);

    /**
     * 批阅
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/graded")
    Boolean graded(@Validated ExamGradeReqVo vo);

    /**
     * 批阅信息
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/grade-info")
    GradeInfoRspVO gradeInfo(@Validated ExamGradeInfoReqVo vo);

    /**
     * 考试概况
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/stat")
    HashMap<String, Object> stat(@Validated ExamVo vo);

    /**
     * 回答列表
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/answered-list")
    PageVO<ExamAnswersDTO> answeredList(@Validated ExamAnswerListVo vo);

    /**
     * 回答导出
     *
     * @param vo
     * @return
     */
    @PostMapping("/console/export")
    Boolean exportAnswer(@Validated ExamAnswerExportReqVo vo);
}
